<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="gradeHorariaItem" styleClass="edit">

        <rich:panel>
            <f:facet name="header">#{gradeHorariaItemHome.managed ? 'Edit' : 'Add'} Grade horaria item</f:facet>


            <s:decorate id="idtGradeHorariaItemField" template="layout/edit.xhtml">
                <ui:define name="label">Idt grade horaria item</ui:define>
                <h:inputText id="idtGradeHorariaItem"
                       required="true"
                       disabled="#{gradeHorariaItemHome.managed}"
                          value="#{gradeHorariaItemHome.instance.idtGradeHorariaItem}">
                    <a:support event="onblur" reRender="idtGradeHorariaItemField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>






            <s:decorate id="indDiaSemanaField" template="layout/edit.xhtml">
                <ui:define name="label">Ind dia semana</ui:define>
                <h:inputText id="indDiaSemana"
                       required="true"
                          value="#{gradeHorariaItemHome.instance.indDiaSemana}">
                    <a:support event="onblur" reRender="indDiaSemanaField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="numHoraFimField" template="layout/edit.xhtml">
                <ui:define name="label">Num hora fim</ui:define>
                <h:inputText id="numHoraFim"
                           size="5"
                          value="#{gradeHorariaItemHome.instance.numHoraFim}">
                    <s:convertDateTime type="time"/>
                    <a:support event="onblur" reRender="numHoraFimField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>


            <s:decorate id="numHoraInicioField" template="layout/edit.xhtml">
                <ui:define name="label">Num hora inicio</ui:define>
                <h:inputText id="numHoraInicio"
                           size="5"
                          value="#{gradeHorariaItemHome.instance.numHoraInicio}">
                    <s:convertDateTime type="time"/>
                    <a:support event="onblur" reRender="numHoraInicioField" bypassUpdates="true" ajaxSingle="true"/>
                </h:inputText>
            </s:decorate>

            <div style="clear:both">
                <span class="required">*</span>
                required fields
            </div>

        </rich:panel>

        <div class="actionButtons">

            <h:commandButton id="save"
                          value="Save"
                         action="#{gradeHorariaItemHome.persist}"
                       disabled="#{!gradeHorariaItemHome.wired}"
                       rendered="#{!gradeHorariaItemHome.managed}"/>

            <h:commandButton id="update"
                          value="Save"
                         action="#{gradeHorariaItemHome.update}"
                       rendered="#{gradeHorariaItemHome.managed}"/>

            <h:commandButton id="delete"
                          value="Delete"
                         action="#{gradeHorariaItemHome.remove}"
                      immediate="true"
                       rendered="#{gradeHorariaItemHome.managed}"/>

            <s:button id="cancelEdit"
                   value="Cancel"
             propagation="end"
                    view="/GradeHorariaItem.xhtml"
                rendered="#{gradeHorariaItemHome.managed}"/>

            <s:button id="cancelAdd"
                   value="Cancel"
             propagation="end"
                    view="/#{empty gradeHorariaItemFrom ? 'GradeHorariaItemList' : gradeHorariaItemFrom}.xhtml"
                rendered="#{!gradeHorariaItemHome.managed}"/>

        </div>
    </h:form>

<rich:tabPanel switchType="ajax">

    <rich:tab label="Localizacao">
    <div class="association" id="localizacaoParent">

        <h:outputText value="There is no localizacao associated with this gradeHorariaItem."
                   rendered="#{gradeHorariaItemHome.instance.localizacao == null}"/>

        <rich:dataTable var="_localizacao"
                   value="#{gradeHorariaItemHome.instance.localizacao}"
                rendered="#{gradeHorariaItemHome.instance.localizacao != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="localizacaoTable">
            <h:column>
                <f:facet name="header">Idt localizacao</f:facet>
                <h:outputText value="#{_localizacao.idtLocalizacao}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Des localizacao</f:facet>
                <h:outputText value="#{_localizacao.desLocalizacao}"/>
            </h:column>
        </rich:dataTable>

        <div class="actionButtons">
            <s:button id="#{gradeHorariaItemHome.instance.localizacao != null ? 'changeParent' : 'selectParent'}" value="#{gradeHorariaItemHome.instance.localizacao != null ? 'Change' : 'Select'} localizacao"
                       view="/LocalizacaoList.xhtml">
                <f:param name="from" value="GradeHorariaItemEdit"/>
            </s:button>
        </div>

    </div>
    </rich:tab>

    <rich:tab label="Grade horaria">
    <div class="association" id="gradeHorariaParent">

        <h:outputText value="There is no gradeHoraria associated with this gradeHorariaItem."
                   rendered="#{gradeHorariaItemHome.instance.gradeHoraria == null}"/>

        <rich:dataTable var="_gradeHoraria"
                   value="#{gradeHorariaItemHome.instance.gradeHoraria}"
                rendered="#{gradeHorariaItemHome.instance.gradeHoraria != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="gradeHorariaTable">
            <h:column>
                <f:facet name="header">Idt grade horaria</f:facet>
                <h:outputText value="#{_gradeHoraria.idtGradeHoraria}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Turma idt turma</f:facet>
                <h:outputText value="#{_gradeHoraria.turma.idtTurma}"/>
            </h:column>
        </rich:dataTable>

        <div class="actionButtons">
            <s:button id="#{gradeHorariaItemHome.instance.gradeHoraria != null ? 'changeParent' : 'selectParent'}" value="#{gradeHorariaItemHome.instance.gradeHoraria != null ? 'Change' : 'Select'} gradeHoraria"
                       view="/GradeHorariaList.xhtml">
                <f:param name="from" value="GradeHorariaItemEdit"/>
            </s:button>
        </div>

    </div>
    </rich:tab>

    <rich:tab label="Disciplina *" labelClass="required">
    <div class="association" id="disciplinaParent">

        <h:outputText value="There is no disciplina associated with this gradeHorariaItem."
                   rendered="#{gradeHorariaItemHome.instance.disciplina == null}"/>

        <rich:dataTable var="_disciplina"
                   value="#{gradeHorariaItemHome.instance.disciplina}"
                rendered="#{gradeHorariaItemHome.instance.disciplina != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="disciplinaTable">
            <h:column>
                <f:facet name="header">Idt disciplina</f:facet>
                <h:outputText value="#{_disciplina.idtDisciplina}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Cod disciplina</f:facet>
                <h:outputText value="#{_disciplina.codDisciplina}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Des disciplina</f:facet>
                <h:outputText value="#{_disciplina.desDisciplina}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Nom disciplina</f:facet>
                <h:outputText value="#{_disciplina.nomDisciplina}"/>
            </h:column>
        </rich:dataTable>

        <div class="actionButtons">
            <s:button id="#{gradeHorariaItemHome.instance.disciplina != null ? 'changeParent' : 'selectParent'}" value="#{gradeHorariaItemHome.instance.disciplina != null ? 'Change' : 'Select'} disciplina"
                       view="/DisciplinaList.xhtml">
                <f:param name="from" value="GradeHorariaItemEdit"/>
            </s:button>
        </div>

    </div>
    </rich:tab>

    <rich:tab label="Professor">
    <div class="association" id="professorParent">

        <h:outputText value="There is no professor associated with this gradeHorariaItem."
                   rendered="#{gradeHorariaItemHome.instance.professor == null}"/>

        <rich:dataTable var="_professor"
                   value="#{gradeHorariaItemHome.instance.professor}"
                rendered="#{gradeHorariaItemHome.instance.professor != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="professorTable">
            <h:column>
                <f:facet name="header">Idt professor</f:facet>
                <h:outputText value="#{_professor.idtProfessor}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Endereco idt cep</f:facet>
                <h:outputText value="#{_professor.endereco.idtCep}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Des complemento</f:facet>
                <h:outputText value="#{_professor.desComplemento}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Nom professor</f:facet>
                <h:outputText value="#{_professor.nomProfessor}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Num endereco</f:facet>
                <h:outputText value="#{_professor.numEndereco}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Num rm</f:facet>
                <h:outputText value="#{_professor.numRm}"/>
            </h:column>
        </rich:dataTable>

        <div class="actionButtons">
            <s:button id="#{gradeHorariaItemHome.instance.professor != null ? 'changeParent' : 'selectParent'}" value="#{gradeHorariaItemHome.instance.professor != null ? 'Change' : 'Select'} professor"
                       view="/ProfessorList.xhtml">
                <f:param name="from" value="GradeHorariaItemEdit"/>
            </s:button>
        </div>

    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
